package com.abhinav.spring.bean;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component("textEditor")
public class TextEditor {
	private SpellChecker spellChecker;
	
	public TextEditor() {
		System.out.println("Inside TextEditor constructor.");
	}

	@Autowired(required=false)
	public TextEditor(SpellChecker spellChecker) {
		this.spellChecker = spellChecker;
		System.out.println("Inside TextEditor parameterized constructor.");
	}

	/*public void setSpellChecker(SpellChecker spellChecker) {
		this.spellChecker = spellChecker;
	}

	public SpellChecker getSpellChecker() {
		return spellChecker;
	}*/

	public void spellCheck() {
		spellChecker.checkSpelling();
	}

}
